#ifndef MSG_ASSEM_H
#define MSG_ASSEM_H

#include "common.h"
#include <arpa/inet.h>
#include "re_chck.h"

typedef struct _PASS_MSG
{
	UINT8 pbody[MAX_PKG_LEN*4];
	INT8 sim[12];
	UINT16 msgId;
	pthread_mutex_t mutex;
}PASS_MSG;

INT32 msgHead_assem(MSG_HD *pIn, UINT8 *pOut);
INT32 msgTail_assem(UINT8 *pTail, UINT8 crc);
INT32 send_package(UINT8 *pMsg, UINT8 len, INT32 sfd);
INT32 platform_common_ack(UINT16 ackSeqNum, UINT16 ackId, UINT8 result, INT32 sfd);
INT32 term_register_ack(UINT16 ackSeqNum, INT8 result, UINT8 *aKey, INT32 sfd);//0 have akey
//INT32 platf_msg_assem(UINT8 *pbody, INT32 datLen, UINT16 msgId, INT32 tsfd;
INT32 platf_msg_assem(UINT8 *pbody, INT32 datLen, PASS_MSG *pass, INT32 tsfd);//sfd is terminal

#endif/* msg_assem.h*/
